package com.heima.article.controller;

import com.heima.article.service.ApArticleService;
import com.heima.model.common.dtos.CollectionBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Geralt
 * @Date 2024-08-02 11:25
 */
@Slf4j
@RestController
@RequestMapping("/api/v1")
public class CollectionController {

    @Autowired
    private ApArticleService apArticleService;
    /**
     * 文章收藏
     * @param collectionBehaviorDto
     * @return
     */
    @PostMapping("/collection_behavior")
    public ResponseResult collectionBehavior(@RequestBody CollectionBehaviorDto collectionBehaviorDto) {
        log.info("文章收藏的数据是：{}", collectionBehaviorDto);
        return apArticleService.collection(collectionBehaviorDto);
    }
}
